#ifndef SceneEngine_h
#define SceneEngine_h

struct SceneLevel
{
	bool isOpen;		//if true to paint
	int numElement; 	//the number of element of a level (scene)
	int* elememt;		//elements of scene with params
	SceneLevel (): isOpen(0){};
};


class SceneEngine
{
private:	
	SceneLevel* sceneLevel;

	int countFPS, currentFPS;
	long FPSLastTime;

	//param
	int sceneEngine_template;
	int sceneEngine_x;
	int sceneEngine_y;
	int sceneEngine_w;
	int sceneEngine_h;
	bool sceneEngine_visible;
	int sceneEngine_spriteID;
	int sceneEngine_frameID;
	int sceneEngine_framePressID;
	int sceneEngine_animID;
	int sceneEngine_animCount;
	int sceneEngine_scale;
	int sceneEngine_fontID;
	int sceneEngine_textID;
	int sceneEngine_anchor;
	int sceneEngine_tapable;
	int sceneEngine_focus;
	int sceneEngine_pressed;
	int sceneEngine_speed;


public:

	//define pagram
	//common
	static const int PARAM_TEMPLATE			= 0;
	static const int PARAM_X				= 1;
	static const int PARAM_Y				= 2;
	static const int PARAM_W				= 3;
	static const int PARAM_H				= 4;
	static const int PARAM_VISIBLE			= 5;
	//special
	//SpriteBased
	static const int PARAM_SPRITE_ID		= 3;
	static const int PARAM_FRAME_ID			= 4;	
	static const int PARAM_ANIM_ID			= 6;
	static const int PARAM_ANIM_COUNT		= 7;  //count loop
	static const int PARAM_SCALE			= 8; 
	//StringBased
	static const int PARAM_FONT_ID			= 3; 
	static const int PARAM_TEXT_ID			= 4; 
	static const int PARAM_HALIGN			= 6; 
	static const int PARAM_VALIGN			= 7; 
	//Button
	static const int PARAM_FRAME_PRESSED	= 6; 
	static const int PARAM_TAPABLE			= 7; 
	static const int PARAM_FOCUS			= 8; 
	static const int PARAM_PRESSED			= 9; 
	static const int PARAM_BUTTON_SCALE		= 10; 
	//ScrollingText
	static const int PARAM_SCROLL_TEXT_FONT_ID	= 6; 
	static const int PARAM_SCROLL_TEXT_TEXT_ID	= 7; 
	static const int PARAM_SCROLL_TEXT_HALIGN	= 8; 
	static const int PARAM_SCROLL_TEXT_VALIGN	= 9; 
	static const int PARAM_SCROLL_TEXT_SPEED	= 10; 
	


	static SceneEngine* sceneEngine;
	static SceneEngine* GetSceneEngine();

	SceneEngine();
	~SceneEngine();
	
	//Open scene
	void OpenScene ( int sceneID );	

	//close scene
	void CloseScene ( int sceneID );

	//load levels into sceneLevel
	void LoadScene ( char *guiPackName );

	//paint scene detail
	void PaintScene ( int sceneID, int _x, int _y );

	//get properties
	void GetSceneElementProperties ( int sceneID, int elementID );
	
	void PaintFPS ();
};
#endif